// Set a callback to run when the Google Visualization API is loaded.
google.setOnLoadCallback(drawCacheChart);

// Callback that creates and populates a data table,
// instantiates the pie chart, passes in the data and
// draws it.
function drawCacheChart() {
  // Create the data table.
  var dataCacheChart = new google.visualization.DataTable();
  dataCacheChart.addColumn('string', 'Cache');
  dataCacheChart.addColumn('number', 'Value');
  dataCacheChart.addRows([
    ['Hits', {{ status['opcache_statistics']['hits'] }}],
    ['Misses', {{ status['opcache_statistics']['misses'] }}],
    ['Blacklist Misses', {{ status['opcache_statistics']['blacklist_misses'] }}],
  ]);

  // Set chart options
  var optionsCacheChart = {'title':'Cache Usage',
    'width':400,
    'height':300};

  // Instantiate and draw our chart, passing in some options.
  var chartCacheChart = new google.visualization.PieChart(document.getElementById('cachechart_div'));
  chartCacheChart.draw(dataCacheChart, optionsCacheChart);
}
